/**
 * 自定义state
 * @module store/state
 *
 */
import Metadata from './metadata'
export default {
  // 组件库组件参数集合
  props: {},

  // 组件公共参数库
  common: [],

  // 当前表单的配置实体
  formModel: null,

  // 当前制作的表单字段集合
  fields: [],

  // 正在编辑的字段
  editField: null,
  tab_id:0,

  tableField:[],

  tableEditField:null,

  tableDataField:[],

  // 组件库组件参数集合
  tableProps: {},

  tabsField:[],

  tabsEditField:null,

  subFromField:{},

  leftButtonField:[],
  ButtonEditField:null,

  rightButtonField:[],

  editType : null,

  setting: Object.assign({
    demoMode: false,
    phoneSize: {
      name: 'Mobile S',
      width: '100%',
      height: '100%'
    },
    open: true, // 网格开关
    line: true, // 智能参考线显示
    color: '#409EFF', // 参考线颜色
    phoneline: true, // 手机框
    sorb: true, // 是否拖拽吸附
  }, (() => {
    let editorSetting = {}
    try {
      editorSetting = JSON.parse(window.localStorage.getItem('EditorSetting')) || {}
    } catch (error) {}
    delete editorSetting.phoneSize
    delete editorSetting.demoMode
    return editorSetting
  })()),
  RootNodeInfo: {},
  nodeInfo: {},
  componentList: {},
  componentMap: {},
  pageInfo: {
    lastPage: '',
    currentPage: ''
  },
  DataHub: {},
  Metadata,
  viewOption: {
    currentLayout: (() => window.localStorage.getItem('dockLayout_type') || 'default')(),
    pageType: 0,
    layouts: [
      {
        type: 'default',
        name: '默认布局'
      }
    ],
    widgets: {
      'widgetComponent': '组件列表',
      'widgetCombinedComponents': '组合组件',
      'widgetComponentTree': '组件树',
      'widgetList': '列表',
      'widgetScene': '场景',
      // 'widgetComponentInfo': '组件详情',
      // 'widgetPageInfo': '页面设置',
      'widgetAttribute': '属性',
    }
  }
}
